package kz.kstu.ds.chooser.filter;

import javax.swing.filechooser.FileFilter;
import java.io.File;

/**
 * Date: 04.11.12
 * Time: 22:48
 *
 * @author Oleg Anastassov
 */
public class TextFileFilter extends FileFilter {

    private static final String TXT_EXT = ".txt";

    @Override
    public boolean accept(File f) {
        return f.isDirectory() || f.getName().endsWith(TXT_EXT);
    }

    @Override
    public String getDescription() {
        return "Текстовые файлы (*.txt)";
    }

}
